// pages/detail/detail.js
Page({
  data: {
    lists:[]
  },
  onLoad: function (options) {
    let id  = options.id;
    let url = `http://192.168.6.62:3000/playlist/detail?id=${id}`;
    wx.request({
      url: url,
      method: 'GET',
      success: res=>{
        let tracks = res.data.playlist.tracks;
        // id,name,picUrl
        let lists = [];
        tracks.forEach((value,index)=>{
          let al = value.al;
          let id = al.id;
          let name = al.name;
          let picUrl = al.picUrl;
          lists.push({
            id:id,
            name:name,
            picUrl:picUrl
          })
        })
        this.setData({
          lists:lists
        })
      }
    })
  }
})